﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WMSADL.SY;
using WMSAML.SY;

namespace WMSABL.SY
{
    public class TRoles_BLL
    {
        TRoles_DAL dal = new TRoles_DAL();

        /// <summary>
        /// 新增
        /// </summary>
        public bool AddTRoles(TRoles_Entity entity)
        {
            return this.Add(entity) > 0 ? false : true;
        }

        /// <summary>
        /// 
        /// </summary>
        public int Add(TRoles_Entity entity)
        {
            return dal.Add(entity);
        }

        /// <summary>
        /// 
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(TRoles_Entity entity)
        {
            return dal.Update(entity);
        }
        /// <summary>
        /// ByID
        /// </summary>
        public bool ExistsByID(int id)
        {
            return dal.ExistsByID(id);
        }

        /// <summary>
        /// ByName
        /// </summary>
        public bool ExistsByName(string role_name)
        {
            return dal.ExistsByName(role_name);
        }

        /// <summary>
        /// ByName
        /// </summary>
        /// <summary>
        public TRoles_Entity GetEntityByName(string role_name)
        {
            return dal.GetEntityByName(role_name);
        }

        /// <summary>
        /// ByID
        /// </summary>
        /// <summary>
        public TRoles_Entity GetEntityByID(int id)
        {
            return dal.GetEntityByID(id);
        }

    }
}
